<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 2. 封装一个函数,用于求圆的周长和面积   Math.PI  = 3.1415…
        function sAndC (a){
            var S = Math.PI*a*a;
            var C = Math.PI*2*a;
            return [S,C];
        }
        var SC = sAndC(3);
        console.log(SC);
    </script>
</body>
</html>